package com.lwm.controller;

import com.github.pagehelper.PageInfo;
import com.lwm.domain.PurchaseApproval;
import com.lwm.domain.ResponseResult;
import com.lwm.dto.PageParams;
import com.lwm.service.PurchaseApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 * 采购申请表(PurchaseApproval)表控制层
 *
 * @author lzl
 * @since 2023-10-17 16:13:56
 */
@RestController
@RequestMapping("purchaseApproval")
public class PurchaseApprovalController {
    /**
     * 服务对象
     */
    @Autowired
    private PurchaseApprovalService purchaseApprovalService;


    @GetMapping("{id}")
    public ResponseResult<PurchaseApproval> getById(@PathVariable Long id) {
        return purchaseApprovalService.getById(id);
    }

    @GetMapping("/page")
    public ResponseResult<PageInfo<PurchaseApproval>> page(PurchaseApproval purchaseApproval, PageParams pageParams) {
        return purchaseApprovalService.page(purchaseApproval, pageParams);
    }

    @PutMapping
    public ResponseResult update(@RequestBody PurchaseApproval purchaseApproval) {
        return purchaseApprovalService.update(purchaseApproval);
    }


}

